<?php
if(defined("_PARA_FORUM_MESSAGE_BODY"))
    return;
define("_PARA_FORUM_MESSAGE_BODY", 1);

require_once "HTMLable.php";

class ForumMessageBody extends HTMLable {
    public $id;
    public $text;
    private $parent;

    public function ForumMessageBody( $id, $text ) {
        $this->id   = $id;
        $this->text = $text;
    }

    public function htmlize( $options ) {

        $formatter = new TextFormatter( $this->text );
        $formatter->main_class = "para_forum_msg_body";


        $formatter->htmlize( array( 'id' => 'para_forum_msg_body_' . $this->id ) );



        if( !$options['no_controls'] ) {
            $oc1 = "onclick=\"para_forum_uev_toggle_body($this->id)\"";
            $oc2 = "onclick=\"para_forum_uev_reply_to( $this->id )\"";

            echo "<div class=\"para_forum_msg_body_ctrls\">",
                "<span class=\"para_forum_msg_body_ctrls_close\" $oc1>Close</span>",
                "<span class=\"para_forum_msg_body_ctrls_reply\" $oc2>Reply</span>",
                "</div>\n";
        }
    }


    public function set_parent( $parent ) {
        $this->parent = $parent;
    }
}